package com.cy.sapling.search.service;

import com.cy.sapling.search.dao.GoodsDao;
import com.cy.sapling.search.entity.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/11/21.
 */
@RestController
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsDao goodsDao;

    @Override
//    @GetMapping("/goodsById/{id}")
    public Goods goodsById(@PathVariable("id") Long id) {
        return goodsDao.getOne(id);
    }

    @Override
//    @GetMapping("/getAllList")
    public List<Goods> getAllList() {
        return goodsDao.findAll();
    }
}
